import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
//@ts-ignore
import AutoImport from 'unplugin-auto-import/vite'
//@ts-ignore
import Components from 'unplugin-vue-components/vite'
//@ts-ignore
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import * as path from 'path'

export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    })
  ],
  resolve: {
    // 配置路径别名
    alias: [
      // @代替src
      {
        find: '@',
        replacement: path.resolve('./src'),
      },
    ],
  },
})